/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author mosipdkara
 */
@Entity
@Table(name = "detayis")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Detayis.findAll", query = "SELECT d FROM Detayis d"),
    @NamedQuery(name = "Detayis.findByDetayIsId", query = "SELECT d FROM Detayis d WHERE d.detayIsId = :detayIsId"),
    @NamedQuery(name = "Detayis.findByDetayIsAdi", query = "SELECT d FROM Detayis d WHERE d.detayIsAdi = :detayIsAdi"),
    @NamedQuery(name = "Detayis.findByDetayIsAciklama", query = "SELECT d FROM Detayis d WHERE d.detayIsAciklama = :detayIsAciklama")})
public class Detayis implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "DetayIsId")
    private Integer detayIsId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 145)
    @Column(name = "DetayIsAdi")
    private String detayIsAdi;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 345)
    @Column(name = "DetayIsAciklama")
    private String detayIsAciklama;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "talepDetayIsId")
    private List<Talepedilenis> talepedilenisList;
    @JoinColumn(name = "MasterIsId", referencedColumnName = "MasterIsId")
    @ManyToOne(optional = false)
    private Masteris masterIsId;

    public Detayis() {
    }

    public Detayis(Integer detayIsId) {
        this.detayIsId = detayIsId;
    }

    public Detayis(Integer detayIsId, String detayIsAdi, String detayIsAciklama) {
        this.detayIsId = detayIsId;
        this.detayIsAdi = detayIsAdi;
        this.detayIsAciklama = detayIsAciklama;
    }

    public Integer getDetayIsId() {
        return detayIsId;
    }

    public void setDetayIsId(Integer detayIsId) {
        this.detayIsId = detayIsId;
    }

    public String getDetayIsAdi() {
        return detayIsAdi;
    }

    public void setDetayIsAdi(String detayIsAdi) {
        this.detayIsAdi = detayIsAdi;
    }

    public String getDetayIsAciklama() {
        return detayIsAciklama;
    }

    public void setDetayIsAciklama(String detayIsAciklama) {
        this.detayIsAciklama = detayIsAciklama;
    }

    @XmlTransient
    public List<Talepedilenis> getTalepedilenisList() {
        return talepedilenisList;
    }

    public void setTalepedilenisList(List<Talepedilenis> talepedilenisList) {
        this.talepedilenisList = talepedilenisList;
    }

    public Masteris getMasterIsId() {
        return masterIsId;
    }

    public void setMasterIsId(Masteris masterIsId) {
        this.masterIsId = masterIsId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (detayIsId != null ? detayIsId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Detayis)) {
            return false;
        }
        Detayis other = (Detayis) object;
        if ((this.detayIsId == null && other.detayIsId != null) || (this.detayIsId != null && !this.detayIsId.equals(other.detayIsId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Detayis[ detayIsId=" + detayIsId + " ]";
    }
    
}
